<?php
/**
 * @version		$Id: hosting_plans.php 8 2011-12-23 15:25:34Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.controlleradmin');


class AlmHosterControllerHosting_plans extends JControllerAdmin
{
	public function getModel($name = 'Hosting_plan', $prefix = 'AlmHosterModel') 
	{
		$model = parent::getModel($name, $prefix, array('ignore_request' => true));
		return $model;
	}
	
	public	function update_plans()
	{
		$app = JFactory::getApplication();
		$urlredirect = "index.php?option=com_almhoster&view=hosting_plans";
		
		$model       = &$this->getModel ( 'hosting_plan' );
		if (function_exists("curl_init"))
		{	
			$update_plans= $model->update_plans ();	
			$msg         = JText::_( 'COM_ALMHOSTER_WHM_PLANS_UPDATED' ) ;		
			$app->redirect( $urlredirect, $msg );
		} else {
			$msg         = JText::_( 'COM_ALMHOSTER_CURL_NOT_ENABLED' ) ;	
			$app->redirect( $urlredirect, $msg );		
			}
	
	}
}
